This is a really cheap way to secure your perimeter. It would give you the heads-up if a predator (animal or human) approaches your camp. I’m not convinced that the beeping would be enough to frighten off a bear, but if you install the line far enough from your bed, you could have sufficient time to pull out a weapon or bear spray.
Also, a beeper is never going to replace bushcraft. Always keep your food away from your bed – and hang it or put it in a bear-proof food locker, don’t leave it on the ground or in your vehicle at night. Do not store food in your car after dark: use a food locker. While a bear can smell food in a locker, the bear can’t get into the locker if it’s closed and latched properly. Be sure to keep your locker closed and latched at all times, even if you are in your campsite.
Remember to clear your car of food wrappers, crumbs in baby seats, and baby wipes–and even canned food and drinks. Bears see lots of things as food that we don’t. “Food” includes any item with a scent, regardless of packaging. This may include items that you do not consider food, such as canned goods, bottles, drinks, soaps, cosmetics, toiletries, trash, ice chests (even when empty), and unwashed items used for preparing or eating meals. All these items must be stored properly.